3.257 \(\int \frac{(e+f x)^3 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx\)

Optimal. Leaf size=99 \[ -\frac{6 f^2 (e+f x) \cos (c+d x)}{a d^3}-\frac{3 f (e+f x)^2 \sin (c+d x)}{a d^2}+\frac{6 f^3 \sin (c+d x)}{a d^4}+\frac{(e+f x)^3 \cos (c+d x)}{a d}+\frac{(e+f x)^4}{4 a f} \]

[Out]

(e + f*x)^4/(4*a*f) - (6*f^2*(e + f*x)*Cos[c + d*x])/(a*d^3) + ((e + f*x)^3*Cos[c + d*x])/(a*d) + (6*f^3*Sin[c
 + d*x])/(a*d^4) - (3*f*(e + f*x)^2*Sin[c + d*x])/(a*d^2)

________________________________________________________________________________________

Rubi [A]  time = 0.144176, antiderivative size = 99, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 4, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {4523, 32, 3296, 2637} \[ -\frac{6 f^2 (e+f x) \cos (c+d x)}{a d^3}-\frac{3 f (e+f x)^2 \sin (c+d x)}{a d^2}+\frac{6 f^3 \sin (c+d x)}{a d^4}+\frac{(e+f x)^3 \cos (c+d x)}{a d}+\frac{(e+f x)^4}{4 a f} \]

Antiderivative was successfully verified.

[In]

Int[((e + f*x)^3*Cos[c + d*x]^2)/(a + a*Sin[c + d*x]),x]

[Out]

(e + f*x)^4/(4*a*f) - (6*f^2*(e + f*x)*Cos[c + d*x])/(a*d^3) + ((e + f*x)^3*Cos[c + d*x])/(a*d) + (6*f^3*Sin[c
 + d*x])/(a*d^4) - (3*f*(e + f*x)^2*Sin[c + d*x])/(a*d^2)

Rule 4523

Int[(Cos[(c_.) + (d_.)*(x_)]^(n_)*((e_.) + (f_.)*(x_))^(m_.))/((a_) + (b_.)*Sin[(c_.) + (d_.)*(x_)]), x_Symbol
] :> Dist[1/a, Int[(e + f*x)^m*Cos[c + d*x]^(n - 2), x], x] - Dist[1/b, Int[(e + f*x)^m*Cos[c + d*x]^(n - 2)*S
in[c + d*x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 1] && EqQ[a^2 - b^2, 0]

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 3296

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> -Simp[((c + d*x)^m*Cos[e + f*x])/f, x] +
Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{(e+f x)^3 \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx &=\frac{\int (e+f x)^3 \, dx}{a}-\frac{\int (e+f x)^3 \sin (c+d x) \, dx}{a}\\ &=\frac{(e+f x)^4}{4 a f}+\frac{(e+f x)^3 \cos (c+d x)}{a d}-\frac{(3 f) \int (e+f x)^2 \cos (c+d x) \, dx}{a d}\\ &=\frac{(e+f x)^4}{4 a f}+\frac{(e+f x)^3 \cos (c+d x)}{a d}-\frac{3 f (e+f x)^2 \sin (c+d x)}{a d^2}+\frac{\left (6 f^2\right ) \int (e+f x) \sin (c+d x) \, dx}{a d^2}\\ &=\frac{(e+f x)^4}{4 a f}-\frac{6 f^2 (e+f x) \cos (c+d x)}{a d^3}+\frac{(e+f x)^3 \cos (c+d x)}{a d}-\frac{3 f (e+f x)^2 \sin (c+d x)}{a d^2}+\frac{\left (6 f^3\right ) \int \cos (c+d x) \, dx}{a d^3}\\ &=\frac{(e+f x)^4}{4 a f}-\frac{6 f^2 (e+f x) \cos (c+d x)}{a d^3}+\frac{(e+f x)^3 \cos (c+d x)}{a d}+\frac{6 f^3 \sin (c+d x)}{a d^4}-\frac{3 f (e+f x)^2 \sin (c+d x)}{a d^2}\\ \end{align*}

Mathematica [A]  time = 0.642866, size = 102, normalized size = 1.03 \[ \frac{-12 f \sin (c+d x) \left (d^2 (e+f x)^2-2 f^2\right )+4 d (e+f x) \cos (c+d x) \left (d^2 (e+f x)^2-6 f^2\right )+d^4 x \left (6 e^2 f x+4 e^3+4 e f^2 x^2+f^3 x^3\right )}{4 a d^4} \]

Antiderivative was successfully verified.

[In]

Integrate[((e + f*x)^3*Cos[c + d*x]^2)/(a + a*Sin[c + d*x]),x]

[Out]

(d^4*x*(4*e^3 + 6*e^2*f*x + 4*e*f^2*x^2 + f^3*x^3) + 4*d*(e + f*x)*(-6*f^2 + d^2*(e + f*x)^2)*Cos[c + d*x] - 1
2*f*(-2*f^2 + d^2*(e + f*x)^2)*Sin[c + d*x])/(4*a*d^4)

________________________________________________________________________________________

Maple [B]  time = 0.066, size = 436, normalized size = 4.4 \begin{align*} -{\frac{1}{{d}^{4}a} \left ({f}^{3} \left ( - \left ( dx+c \right ) ^{3}\cos \left ( dx+c \right ) +3\, \left ( dx+c \right ) ^{2}\sin \left ( dx+c \right ) -6\,\sin \left ( dx+c \right ) +6\, \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) -3\,c{f}^{3} \left ( - \left ( dx+c \right ) ^{2}\cos \left ( dx+c \right ) +2\,\cos \left ( dx+c \right ) +2\, \left ( dx+c \right ) \sin \left ( dx+c \right ) \right ) +3\,{f}^{2}ed \left ( - \left ( dx+c \right ) ^{2}\cos \left ( dx+c \right ) +2\,\cos \left ( dx+c \right ) +2\, \left ( dx+c \right ) \sin \left ( dx+c \right ) \right ) +3\,{c}^{2}{f}^{3} \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) -6\,cde{f}^{2} \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) +3\,{d}^{2}{e}^{2}f \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) +{c}^{3}{f}^{3}\cos \left ( dx+c \right ) -3\,{c}^{2}de{f}^{2}\cos \left ( dx+c \right ) +3\,c{d}^{2}{e}^{2}f\cos \left ( dx+c \right ) -{d}^{3}{e}^{3}\cos \left ( dx+c \right ) -{\frac{{f}^{3} \left ( dx+c \right ) ^{4}}{4}}+c{f}^{3} \left ( dx+c \right ) ^{3}-{f}^{2}ed \left ( dx+c \right ) ^{3}-{\frac{3\,{c}^{2}{f}^{3} \left ( dx+c \right ) ^{2}}{2}}+3\,cde{f}^{2} \left ( dx+c \right ) ^{2}-{\frac{3\,{d}^{2}{e}^{2}f \left ( dx+c \right ) ^{2}}{2}}+{c}^{3}{f}^{3} \left ( dx+c \right ) -3\,{c}^{2}de{f}^{2} \left ( dx+c \right ) +3\,c{d}^{2}{e}^{2}f \left ( dx+c \right ) -{d}^{3}{e}^{3} \left ( dx+c \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((f*x+e)^3*cos(d*x+c)^2/(a+a*sin(d*x+c)),x)

[Out]

-1/d^4/a*(f^3*(-(d*x+c)^3*cos(d*x+c)+3*(d*x+c)^2*sin(d*x+c)-6*sin(d*x+c)+6*(d*x+c)*cos(d*x+c))-3*c*f^3*(-(d*x+
c)^2*cos(d*x+c)+2*cos(d*x+c)+2*(d*x+c)*sin(d*x+c))+3*f^2*e*d*(-(d*x+c)^2*cos(d*x+c)+2*cos(d*x+c)+2*(d*x+c)*sin
(d*x+c))+3*c^2*f^3*(sin(d*x+c)-(d*x+c)*cos(d*x+c))-6*c*d*e*f^2*(sin(d*x+c)-(d*x+c)*cos(d*x+c))+3*d^2*e^2*f*(si
n(d*x+c)-(d*x+c)*cos(d*x+c))+c^3*f^3*cos(d*x+c)-3*c^2*d*e*f^2*cos(d*x+c)+3*c*d^2*e^2*f*cos(d*x+c)-d^3*e^3*cos(
d*x+c)-1/4*f^3*(d*x+c)^4+c*f^3*(d*x+c)^3-f^2*e*d*(d*x+c)^3-3/2*c^2*f^3*(d*x+c)^2+3*c*d*e*f^2*(d*x+c)^2-3/2*d^2
*e^2*f*(d*x+c)^2+c^3*f^3*(d*x+c)-3*c^2*d*e*f^2*(d*x+c)+3*c*d^2*e^2*f*(d*x+c)-d^3*e^3*(d*x+c))

________________________________________________________________________________________

Maxima [B]  time = 1.63407, size = 721, normalized size = 7.28 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)^3*cos(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

-1/4*(8*c^3*f^3*(1/(a*d^3 + a*d^3*sin(d*x + c)^2/(cos(d*x + c) + 1)^2) + arctan(sin(d*x + c)/(cos(d*x + c) + 1
))/(a*d^3)) - 24*c^2*e*f^2*(1/(a*d^2 + a*d^2*sin(d*x + c)^2/(cos(d*x + c) + 1)^2) + arctan(sin(d*x + c)/(cos(d
*x + c) + 1))/(a*d^2)) + 24*c*e^2*f*(1/(a*d + a*d*sin(d*x + c)^2/(cos(d*x + c) + 1)^2) + arctan(sin(d*x + c)/(
cos(d*x + c) + 1))/(a*d)) - 8*e^3*(arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a + 1/(a + a*sin(d*x + c)^2/(cos(d*
x + c) + 1)^2)) - 6*((d*x + c)^2 + 2*(d*x + c)*cos(d*x + c) - 2*sin(d*x + c))*e^2*f/(a*d) + 12*((d*x + c)^2 +
2*(d*x + c)*cos(d*x + c) - 2*sin(d*x + c))*c*e*f^2/(a*d^2) - 6*((d*x + c)^2 + 2*(d*x + c)*cos(d*x + c) - 2*sin
(d*x + c))*c^2*f^3/(a*d^3) - 4*((d*x + c)^3 + 3*((d*x + c)^2 - 2)*cos(d*x + c) - 6*(d*x + c)*sin(d*x + c))*e*f
^2/(a*d^2) + 4*((d*x + c)^3 + 3*((d*x + c)^2 - 2)*cos(d*x + c) - 6*(d*x + c)*sin(d*x + c))*c*f^3/(a*d^3) - ((d
*x + c)^4 + 4*((d*x + c)^3 - 6*d*x - 6*c)*cos(d*x + c) - 12*((d*x + c)^2 - 2)*sin(d*x + c))*f^3/(a*d^3))/d

________________________________________________________________________________________

Fricas [A]  time = 1.6683, size = 329, normalized size = 3.32 \begin{align*} \frac{d^{4} f^{3} x^{4} + 4 \, d^{4} e f^{2} x^{3} + 6 \, d^{4} e^{2} f x^{2} + 4 \, d^{4} e^{3} x + 4 \,{\left (d^{3} f^{3} x^{3} + 3 \, d^{3} e f^{2} x^{2} + d^{3} e^{3} - 6 \, d e f^{2} + 3 \,{\left (d^{3} e^{2} f - 2 \, d f^{3}\right )} x\right )} \cos \left (d x + c\right ) - 12 \,{\left (d^{2} f^{3} x^{2} + 2 \, d^{2} e f^{2} x + d^{2} e^{2} f - 2 \, f^{3}\right )} \sin \left (d x + c\right )}{4 \, a d^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)^3*cos(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/4*(d^4*f^3*x^4 + 4*d^4*e*f^2*x^3 + 6*d^4*e^2*f*x^2 + 4*d^4*e^3*x + 4*(d^3*f^3*x^3 + 3*d^3*e*f^2*x^2 + d^3*e^
3 - 6*d*e*f^2 + 3*(d^3*e^2*f - 2*d*f^3)*x)*cos(d*x + c) - 12*(d^2*f^3*x^2 + 2*d^2*e*f^2*x + d^2*e^2*f - 2*f^3)
*sin(d*x + c))/(a*d^4)

________________________________________________________________________________________

Sympy [A]  time = 12.7856, size = 1232, normalized size = 12.44 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)**3*cos(d*x+c)**2/(a+a*sin(d*x+c)),x)

[Out]

Piecewise((4*d**4*e**3*x*tan(c/2 + d*x/2)**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 4*d**4*e**3*x/(4*a*d*
*4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 6*d**4*e**2*f*x**2*tan(c/2 + d*x/2)**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*
a*d**4) + 6*d**4*e**2*f*x**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 4*d**4*e*f**2*x**3*tan(c/2 + d*x/2)**
2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 4*d**4*e*f**2*x**3/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + d
**4*f**3*x**4*tan(c/2 + d*x/2)**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + d**4*f**3*x**4/(4*a*d**4*tan(c/2
 + d*x/2)**2 + 4*a*d**4) - 4*d**3*e**3*tan(c/2 + d*x/2)**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 4*d**3*
e**3/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) - 12*d**3*e**2*f*x*tan(c/2 + d*x/2)**2/(4*a*d**4*tan(c/2 + d*x/
2)**2 + 4*a*d**4) + 12*d**3*e**2*f*x/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) - 12*d**3*e*f**2*x**2*tan(c/2 +
 d*x/2)**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 12*d**3*e*f**2*x**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a
*d**4) - 4*d**3*f**3*x**3*tan(c/2 + d*x/2)**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 4*d**3*f**3*x**3/(4*
a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 12*d**2*e**2*f*tan(c/2 + d*x/2)**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*
a*d**4) - 24*d**2*e**2*f*tan(c/2 + d*x/2)/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 12*d**2*e**2*f/(4*a*d**4
*tan(c/2 + d*x/2)**2 + 4*a*d**4) - 48*d**2*e*f**2*x*tan(c/2 + d*x/2)/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4)
 - 24*d**2*f**3*x**2*tan(c/2 + d*x/2)/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 24*d*e*f**2*tan(c/2 + d*x/2)
**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) - 24*d*e*f**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 24*d*f
**3*x*tan(c/2 + d*x/2)**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) - 24*d*f**3*x/(4*a*d**4*tan(c/2 + d*x/2)**
2 + 4*a*d**4) - 24*f**3*tan(c/2 + d*x/2)**2/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) + 48*f**3*tan(c/2 + d*x/
2)/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4) - 24*f**3/(4*a*d**4*tan(c/2 + d*x/2)**2 + 4*a*d**4), Ne(d, 0)), (
(e**3*x + 3*e**2*f*x**2/2 + e*f**2*x**3 + f**3*x**4/4)*cos(c)**2/(a*sin(c) + a), True))

________________________________________________________________________________________

Giac [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((f*x+e)^3*cos(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

Timed out